<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fnt" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>CDC疾控中心</title>
    <link rel="stylesheet" href="<%=path%>/web/css/style2.css"/>
    <link rel="stylesheet" href="<%=path%>/web/css/style/style2.css" />
    <script src="<%=path%>/web/js/jq.js"></script>
    <script src="<%=path%>/web/js/jq1.js"></script>
</head>
<body>
<jsp:include page="headerandfoter/header.jsp"></jsp:include>
<br><br><br>
<!--内容开始-->
<div class="content">
    <div class="subject1">
        <div class="subject_con1" id="xxxx">
            <h1>${num+1}、${questions.get(num).subject}？</h1>
            <table width="272" border="0" cellspacing="0" cellpadding="0" class="selected">
                <c:forEach items="${questions.get(num).answers}" var="answers" varStatus="stat">
                <tr>
                    <td style="width: 60px"><input class="daan1" name="abcd" type="radio" value="" /></td>
                    <td>${answers.answerContent}</td>
                </tr>
                </c:forEach>
            </table>
            <div class="clear"></div>
            <div class="anwsercon" style="display:none;" >
                <p style="color:#f00;">正确答案为:
                    <c:forEach items="${questions.get(num).answers}" var="answer" varStatus="stat">
                        <c:if test="${answer.trueAnswer ne '1'}">
                            ${answer.answerContent}
                        </c:if>
                    </c:forEach></p>
                <p class="xiangjie">详解：
                    <span class="jiecon" >${questions.get(num).explain}</span>
                </p>
            </div>
        </div>
        <div class="anwsercard">
            <ul class="anwser_ul">
                <c:forEach begin="1" end="${questions.size()}" var="i">
                    <li>
                        <a href="#" data-id="${i}" class="datika">${i}</a>
                    </li>
                </c:forEach>
                <div class="clear"></div>
            </ul>
            <div class="clear"></div>
        </div>
    </div>
    <div class="collection">
        <ul>
            <li class="subject_a up" id="upq"><a href="#"></a></li>
            <li class="subject_a down" id="downq"><a  href="#"></a></li>
            <li class="collectbg"><a href="#" class="card">展开答题卡</a></li>
        </ul>
    </div>
</div>
<br>
<!--内容结束-->
<!--尾部开始-->
<jsp:include page="headerandfoter/foter.jsp"></jsp:include><!-- 包含尾部 -->
</div>
<!--尾部结束-->
<script type="text/javascript" src="<%=path%>/web/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path%>/web/js/define.js"></script>
<script>var questionTypeId="${requestScope.questionTypeId}";</script>
<script>
    $(function(){
        var divv=$("#xxxx");
        // alert(divv);
        $("#downq").click(function(){
            $.ajax({
                url:"/services/xiayiti1",
                data:{questionTypeId:questionTypeId},
                async:false,
                success:function(html){
                    console.log(html);
                    $("div.subject1").html(html);
                }
            });
        });
    })
    $(function(){
        var divv=$("#xxxx");
        // alert(divv);
        $("#upq").click(function(){
            $.ajax({
                url:"/services/shangyiti1",
                data:{questionTypeId:questionTypeId},
                async:false,
                success:function(html){
                    console.log(html);
                    $("div.subject1").html(html);
                }
            });
        });
        // 答题卡
        $("body").on("click",".datika",function () {
            var count=$(this).data("id");
            console.log(count);
            $.ajax({
                url:"/services/answersPaperq",
                data:{count:count,questionTypeId:questionTypeId},
                type:"post",
                async:false,
                success:function (html) {
                    console.log(html)
                    $(".subject1").html(html);
                }
            });
        })
    })
</script>

</body>
</html>
